use figure6
global covar "ln_pred_nfs_atmcount_pc_pd ln_pred_pos_terminalcount_pc_pd dist_vurban_pd ln_imp_pin_branch_pc_pd sh_natl_dep_amt16_pd sh_natl_dep_ac16_pd ln_imp_pop_pin_pd pin_cc_map_pd"

foreach i of numlist 1/100 { 
quietly reghdfe ln_nfs_totalamount distcc`i'_pnt distcc`i'_plt $covar, absorb(pincode dist_qtr_yr) cluster(pincode) tolerance(0.00001) maxiterations(100000)

gen b_atm_nt`i' = _b[distcc`i'_pnt]
gen se_atm_nt`i' = _se[distcc`i'_pnt]

gen b_atm_lt`i' = _b[distcc`i'_plt]
gen se_atm_lt`i' = _se[distcc`i'_plt]

quietly reghdfe ln_pos_totalamount distcc`i'_pnt distcc`i'_plt $covar, absorb(pincode dist_qtr_yr) cluster(pincode) tolerance(0.00001) maxiterations(100000)

display `i' 

gen b_pos_nt`i' = _b[distcc`i'_pnt]
gen se_pos_nt`i' = _se[distcc`i'_pnt]

gen b_pos_lt`i' = _b[distcc`i'_plt]
gen se_pos_lt`i' = _se[distcc`i'_plt]
}

keep b_atm_nt1- se_pos_lt100
gen x = "Demon"
duplicates drop x, force
reshape long b_atm_nt se_atm_nt b_atm_lt se_atm_lt b_pos_nt se_pos_nt b_pos_lt se_pos_lt, i(x) j(runum)

cumul b_atm_nt, gen(cum_atm_nt)
cumul b_atm_lt, gen(cum_atm_lt)
cumul b_pos_nt, gen(cum_pos_nt)
cumul b_pos_lt, gen(cum_pos_lt)

*Figure 6: Distribution of Near-Term Coefficients, Digital Payments
sort cum_pos_nt
line cum_pos_nt b_pos_nt, xline(.006, lpattern(dash)) ytitle("Placebo Treatment Effect", height(5)) graphregion(color(white)) xtitle("") subtitle("Digital Payments" "Near Term")

*Figure 6: Distribution of Long-Term Coefficients, Digital Payments
sort cum_pos_lt
line cum_pos_lt b_pos_lt, xline(.013, lpattern(dash)) ytitle("Placebo Treatment Effect", height(5)) graphregion(color(white)) xtitle("") subtitle("Digital Payments" "Long Term")

*Figure 6: Distribution of Near-Term Coefficients, Cash Withdrawals
sort cum_atm_nt
line cum_atm_nt b_atm_nt, xline(-.004, lpattern(dash)) ytitle("Placebo Treatment Effect", height(5)) graphregion(color(white)) xtitle("") subtitle("Cash Withdrawals" "Near Term")
graph save atm_nt_placebo, replace

*Figure 6: Distribution of Long-Term Coefficients, Cash Withdrawals
sort cum_atm_lt
line cum_atm_lt b_atm_lt, xline(-.001, lpattern(dash)) ytitle("Placebo Treatment Effect", height(5)) graphregion(color(white)) xtitle("") subtitle("Cash Withdrawals" "Long Term")
